
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="sj" uri="/struts-jquery-tags"%>

<s:form name="formBody" id="formBody">

<s:hidden name="start"/>
<s:hidden name="count"/>
<s:hidden name="orderBy"/>
<s:hidden name="ascDesc"/>
<s:hidden name="previousPage"/>
<s:hidden name="gotoPage"/>
<s:hidden name="actionMethod" value="%{actionMethod}"/>
<s:hidden name="id" value="%{@com.lemurian.bankdata.lite.utils.GlobalFunction@encodeParameter(id)}"/>
<s:token/>

<div class="header">
	<span><span class="ico gray administrator"></span>Ubah Jadwal</span>
</div><!-- End header -->	

<div class="content" >
		<!-- Third / Half column-->
		<div class="widgets">
			<div class="section" >
				<label>Tanggal Tanda Tangan</label>
				<div><s:textfield cssClass="validate[required] datepicker text-input small" name="tanggalTerbaru"/></div>
			</div>
			<div class="section" >
				<label>Pukul</label>
				<div>
					<s:textfield cssClass="validate[required] text-input large" name="jamTerbaru" onchange="validateHhMm(this);"
	                           labelposition="left" maxlength="5" autocomplete="off" style="width: 40px;text-align: center; font-style:italic"/>
	                <span class="f_help">Masukkan jam antara 00:00 s.d. 23:59</span>
				</div>
			</div>
			<div class="section" >
				<label> Tempat </label>   
				<div>
					<s:textfield cssClass="text-input large" name="tempatTerbaru" labelposition="left" maxlength="45" id="name" autocomplete="off"/>
				</div>
	        </div>
			
			<s:if test="signatureSchedule.signatureDate != null">
				<div class="section" >
					<label> Alasan Perubahan jadwal <br>
							(<s:date name="signatureSchedule.signatureDate" format="dd-MMM-yyyy"/> jam <s:date name="signatureSchedule.signatureDate" format="HH:mm"/>) </label>   
					<div>
						<s:textfield cssClass="validate[required] text-input large" name="alasanPembatalan" labelposition="left" maxlength="45" id="name" autocomplete="off"/>
					</div>
				</div>
			</s:if>
			<div class="section" >
		        <div class="section last">
					<s:submit action="PenjadwalanKlienAction_saveUbahJadwal" value="Simpan" cssClass="uibutton icon forward confirm" cssStyle="text-align:right;"/>
		            <a href="PenjadwalanKlienAction_list.do" class="uibutton special">kembali</a>
		        </div>
		    </div>
		</div><!-- End Third / Half column-->
	
   		<!-- clear fix -->
		<div class="clear"></div>

		<div class="tableName">
			<div style= "text-align:right; margin-top: 20px;">
							<!-- a class="uibutton icon special answer" style="text-align:right;" >tolak</a-->
								
			</div>
			<div class="clear"></div>
				
			<table class="display data_table1">
				<thead>
					<tr>
						<th><div class="th_wrapp"><s:text name="label.no"/></div></th>
						<th>Tanggal Tanda Tangan</th>
						<th>Pukul</th>
						<th style="text-align:left">Alasan Pembatalan</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="listHistoryJadwal" status="sequence">
					<tr class="odd gradeX">
						<td><s:property value="%{start+#sequence.index+1}"/></td>
						<td><s:date name="signatureDate" format="dd-MMM-yyyy"/></td>
						<td><s:date name="signatureDate" format="HH:mm"/></td>
						<td style="text-align:left"><s:property value="cancelationReason"/></td>
					</tr>
					</s:iterator>
				</tbody>
			</table>
			<div class="clear"></div>
		</div>
	
   <!-- clear fix -->
<div class="clear"></div>

</div><!-- End content -->
</s:form>
<script TYPE="text/JavaScript">
    function validateHhMm(inputField) {
        var isValid = /^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(inputField.value);

        if (isValid) {
            inputField.style.backgroundColor = '#bfa';
        } else {
            inputField.style.backgroundColor = '#fba';
            alert("Pastikan format jam sudah benar");
        }

        return isValid;
    }
</script>